package chapter01

object Test21_While2 {
  def main(args: Array[String]): Unit = {
    var flag = true
    while(flag){
      println("请输入你的年龄：")
      val age = scala.io.StdIn.readInt()
      if(age>=18){
        println("可以进入")
        flag = false
      }
    }
  }
}
